<?php
declare (strict_types = 1);

namespace app\admin\validate;

use think\Validate;

class Goods extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'title' => 'require',
        'sort' => 'require',
        'type' => 'require',
        'imgurl' => 'require',
        'stock' => 'require',
        'content' => 'require',

       
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'title.require' => '请输入商品名称',
        'sort.require' => '请输入排序值',
        'stock.require' => '请输入库存',
        'imgurl.require' => '请选择上传的图片',

        
    ];

    protected $scene = [
        'add'  =>  ['title','sort','stock'],
        'edit'  =>  ['title','sort','stock'],
    ];
}
